import * as React from 'react'
import { Modal } from 'antd-mobile'
import './index.less'
const alert = Modal.alert

export const msg = (title: string, header?: string) => {
    const styles: React.CSSProperties = { fontSize: '0.8rem', height: '2.25rem', lineHeight: '2.25rem', color: '#333333' }
    const node = <div style={{ color: '#333333', fontSize: '0.8rem' }}>{title}</div>
    return new Promise((resolve, reject) => {
        alert(header || '', node, [
            { text: '取消', style: styles, onPress: () => { reject({}) } },
            { text: '确定', onPress: () => { resolve({}) }, style: { ...styles, background: '#f33f2e', color: '#fff' } }
        ])
    })
}

export const NotBean = (
    <div className="not_bean">
        <img src={require('../assets/not_beans.png')} />
        <div>空空如也，晚点再来看看吧！</div>
    </div>
)

export const NotCart = (
    <div className="not_bean" style={{ paddingBottom: '3rem' }}>
        <img src={require('../assets/not_cart.png')} />
        <div>什么都没有，要孤独死我吗？</div>
    </div>
)

export const NotColl = (
    <div className="not_bean" style={{ paddingBottom: '3rem' }}>
        <img src={require('../assets/not_cart.png')} />
        <div>小主，您还没有任何收藏哟~</div>
    </div>
)

export const NotOrder = (str?: string) => {
    return (
        <div className="not_bean" style={{ paddingBottom: '3rem' }}>
            <img src={require('../assets/not_order.png')} />
            <div>小主，暂无{str ? (str + '的') : ''}订单哟~</div>
        </div>
    )
}